package com.bookmanager.www.controller.rabbitmq;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: 风离
 * @Date: 2021/10/14/15:10
 * @Description:
 */

@Component

public class WorkConsumer {

    @RabbitListener(queuesToDeclare = @Queue(value = "test-work"))
    public void work1(String message)
    {
        System.out.println("message1:"+message);
    }

    @RabbitListener(queuesToDeclare = @Queue(value = "test-work"))
    public void work2(String message)
    {
        System.out.println("message2:"+message);
    }
}
